export default {
  data() {
    const subViews = this.val.subViews
    const topLine = this.val.topLine
    const leftLine = this.val.leftLine
    const bottomLine = this.val.bottomLine
    const rightLine = this.val.rightLine
    return {
      topLine,
      leftLine,
      bottomLine,
      rightLine,
      subViews
    }
  },

  methods: {
    getBorder(lineObj) {
      if (lineObj && lineObj.lineWidth > 0) {
        return lineObj.lineWidth + 'mm solid ' + (lineObj.color ? lineObj.color : '#000000')
      }
      return '1px dashed rgb(200 200 200 / 50%)'
    }
  },

  computed: {
    // 选中项id
    widgetId() {
      return this.$vptd.state.uuid
    },
    borderTop() {
      return this.getBorder(this.topLine)
    },
    borderLeft() {
      return this.getBorder(this.leftLine)
    },
    borderBottom() {
      return this.getBorder(this.bottomLine)
    },
    borderRight() {
      return this.getBorder(this.rightLine)
    },
  },

}
